Fig-1: Marketing Strategy 2
rm(list=ls(all=T))
options(digits=4, scipen=12)
pacman::p_load(ggplot2, manipulate, dplyr, latex2exp)
load("data/tf3.rdata")P = group_by(D, grp) %>% summarise(
size=n(), ## 族群大小
buyProb=mean(Buy), ## 預測3月會回購的機率
revPred=mean(Rev), ## 預測3月會花費多少
totalRev=mean(rev), ## 總收入
totalCost=mean(rev-raw), ## 總成本
totalProfit=mean(raw), ## 總毛利
costRate=mean((rev-raw)/rev), ## 成本率
profitRate=mean(raw/rev), ## 毛利率
freq=mean(f), ## 頻率
avgRev=mean(rev/f), ## 平均每次消費收入
avgCost=mean((rev-raw)/f), ## 平均每次消費成本
avgProfit=mean(raw/f) ## 平均每次消費利潤
)
P## # A tibble: 5 x 13
## grp size buyProb revPred totalRev totalCost totalProfit costRate
## <int> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 1 545 0.981 4150. 14193. 12013. 2180. 0.854
## 2 2 3146 0.439 1800. 6282. 5145. 1137. 0.819
## 3 3 6804 0.296 754. 1053. 891. 162. 0.872
## 4 4 5472 0.785 1057. 4276. 3657. 619. 0.873
## 5 5 12564 0.396 729. 1283. 1094. 189. 0.877
## # ... with 5 more variables: profitRate <dbl>, freq <dbl>, avgRev <dbl>,
## # avgCost <dbl>, avgProfit <dbl>
Fig-2: Marketing Strategy 2
本族群其特性為:
1. 常常平日來買
2. 老顧客
3. 中老年偏多
4. 大都住在114與221
5. 容易受到節慶影響
6. 常購買熱銷產品
data.frame(group=1:5, size=P$size/sum(P$size),
totalRev=P$totalRev/sum(P$totalRev),
totalProfit=P$totalProfit/sum(P$totalProfit))## group size totalRev totalProfit
## 1 1 0.0191 0.52397 0.50852
## 2 2 0.1103 0.23193 0.26524
## 3 3 0.2385 0.03887 0.03771
## 4 4 0.1918 0.15785 0.14435
## 5 5 0.4404 0.04738 0.04419
可以發現第一群的族群數較少(只占2%)預測回購機率:0.981
預測收益:4150
成本率:85.4%
毛利率:14.6%
G1 = subset(D, grp=="1")
profitRate=0.146
P0=G1$Buy
R0=G1$Rev假設此策略的實施最高能提升5%的收入,能接受的成本範圍介於0到20之間 透過模擬能觀察到成本與效果之間的關係,如下圖所示 x軸為成本,y軸則為提升收入的比率 不同的成本所對應的效果會不一樣
使用模擬方法找到最佳策略(參數) 假設: 1. 此策略最高能提升5%的收入(m=0.05) 2. 成本的中心點為10(b=10) 3. 成本前後範圍為20(a=20)
m=0.05; a=20; b=10
curve(m*plogis((10/a)*(x-b)), 0, 30, lwd=2, ylim=c(0, 0.06), ylab="f(x)")
abline(h=seq(0,0.2,0.05),v=seq(0,30,5),col='lightgrey',lty=2)接著,以此方式進一步來模擬當策略真正的實施下,投入的成本多寡所能獲得的額外報酬為何,如第一條式子
假設固定回購機率、花費金額以及毛利率14.6%
其結果如圖所示,呈現不同投入的成本所對應的額外報酬
根據此圖我們挑選最佳的參數也就是成本為15來做為策略的實施
m=0.05; a=20; b=10
c = seq(0,25,0.5)
p = m*plogis((10/a)*(c-b))
totalRoI = c()
for(i in 1:length(c)){
totalRoI = rbind(totalRoI, sum(P0*R0*p[i]*profitRate-c[i]))
}
roiRange = data.frame(cost=c, totalRoI=totalRoI)
roiRange %>% ggplot(aes(x=cost, y=totalRoI)) +
geom_line(size=1.2) +
ggtitle("Cost Effeciency per Segment ")計算額外報酬、總成本以及ROI
m=0.05; a=20; b=10
cost = 15
increasingRate = m*plogis((10/a)*(cost-b))
returnTotal = sum(P0*R0*increasingRate*profitRate-cost)
costTotal = length(P0)*cost
data.frame(cost=cost, increasingRate=increasingRate, returnTotal=returnTotal, costTotal=costTotal, ROI=returnTotal/costTotal)## cost increasingRate returnTotal costTotal ROI
## 1 15 0.04621 6899 8175 0.8439
Fig-3: Conclusion
Fig-4: Marketing Strategy Conclusion